<%--
    Document   : controller
    Created on : 06-jun-2011, 9:23:27
    Author     : Administrador
--%>



<%@page import="logica.util.Perfil"%>
<%@page import="logica.util.ProfilesUtil"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%
	if (request.getParameter("crearPerfil")!=null){
            %><jsp:forward page="formPerfil.jsp"/><%
        }
	if (request.getParameter("lanzarJakin")!=null){
        %><jsp:forward page="lanzarJakin.jsp"/><%
        }
        if (request.getParameter("leyendaRegistros")!=null){
           %><jsp:forward page="leyendaRegistros.jsp"/><%
        }
        if (request.getParameter("perfilesDefecto")!=null){
            ProfilesUtil pUtil=ProfilesUtil.getInstance();
            pUtil.reMake();
            pUtil.addStandarProfiles();
            %><jsp:forward page="index.jsp"/><%
        }
        if(request.getParameter("aceptar")!=null){
            ProfilesUtil pUtil=ProfilesUtil.getInstance();
            Perfil per=new Perfil();
            per.addProfile((String)request.getParameter("rango1"));
            per.addProfile((String)request.getParameter("rango2"));
            per.addProfile((String)request.getParameter("rango3"));
            String [] listaReg = request.getParameterValues("registros");
            for(int loopIndex = 0; loopIndex < listaReg.length; loopIndex++){
                per.addRegistro(listaReg [loopIndex]);
            }
            pUtil.addProfile(per);
            %><jsp:forward page="index.jsp"/><%
        }

        if(request.getParameter("perfil unico")!=null){
            %><jsp:forward page="jakinUnico.jsp"/><%
        }


        if(request.getParameter("lanzar Jakin")!=null){
            if(request.getParameter("curso")!=null){
                ProfilesUtil pUtil=ProfilesUtil.getInstance();
                pUtil.setCurso(Integer.parseInt(request.getParameter("curso")));
            %><jsp:forward page="jakin.jsp"/><%
            }else{
                %><jsp:forward page="index.jsp"/><%
            }
        }

         if(request.getParameter("filtro")!=null){
            if(request.getParameter("filtro")!=null){
                ProfilesUtil pUtil=ProfilesUtil.getInstance();
                String [] listaReg = request.getParameterValues("alumnosfiltrados");

                pUtil.setListaFiltrado(listaReg);
                %><jsp:forward page="jakin.jsp"/><%
            }else{
                %><jsp:forward page="index.jsp"/><%
            }
        }


        if(request.getParameter("lanzarPerfilUnico")!=null){
            if(request.getParameter("curso")!=null){
                ProfilesUtil pUtil=ProfilesUtil.getInstance();
                pUtil.setCurso(Integer.parseInt(request.getParameter("curso")));
                %><jsp:forward page="jakinUnico.jsp"/><%
            }else{
                %><jsp:forward page="index.jsp"/><%
            }
        }

        if(request.getParameter("inicio")!=null){
            %><jsp:forward page="index.jsp"/><%
        }
        if(request.getParameter("borrar")!=null){
            ProfilesUtil pUtil=ProfilesUtil.getInstance();
            pUtil.removeProfile(Integer.parseInt(request.getParameter("borrado")));
            %><jsp:forward page="index.jsp"/><%
        }
	%>
